﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Masquage_et_Surcharge
{
    class Program
    {
        static void Main(string[] args)
        {
            ClasseMere ObjM = new ClasseMere();
            ClasseFille ObjF = new ClasseFille();
            ObjM.meth1(10);
            Console.WriteLine("meth1(10) - ClasseMere : X = " + ObjM.X);
            ObjM.meth1(10, 5);
            Console.WriteLine("meth1(10, 5) - ClasseMere : X = " + ObjM.X);
            ObjF.meth1(10);
            Console.WriteLine("meth1(10) - ClasseFille : X = " + ObjF.X);
            ObjF.meth1(10, 5);
            Console.WriteLine("meth1(10, 5) - ClasseFille : X = " + ObjF.X);
            ObjF.meth1(10, 5, 2);
            Console.WriteLine("meth1(10, 5, 2) - ClasseFille : X = " + ObjF.X);
        }
    }
    public class ClasseMere
    {
        protected int x = 1;
        public void meth1(int a) { x += a; }
        public void meth1(int a, int b) { x += a * b; }
        public int X
        {
            get { return x; }
        }
    }
    public class ClasseFille : ClasseMere
    {
        public new void meth1(int a) { x += a * 100; }
        public void meth1(int a, int b, int c) { x += a * b * c; }
    }
}
